/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.pay.j;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import com.qihoo.gamecenter.sdk.common.h.d;
import com.qihoo.gamecenter.sdk.common.h.d.a;
import com.qihoo.gamecenter.sdk.common.i.s;
import com.qihoo.gamecenter.sdk.pay.e.b;
import com.qihoo.gamecenter.sdk.pay.k.c;
import java.util.Map;
import java.util.TreeMap;
import org.json.JSONObject;

public class m extends d {
    private Intent b;

    public m(Context paramContext, d.a parama, Intent paramIntent) {
        super(paramContext, parama, true);
        this.b = paramIntent;
    }

    protected String a(Context paramContext, String[] paramArrayOfString) {
        return null;
    }

    protected String a() {
        return "https://mgame.360.cn/internal/mobile_pay.json";
    }

    protected Map b(Context paramContext, String[] paramArrayOfString) {
        String str1 = a(0, paramArrayOfString);
        TreeMap localTreeMap = new TreeMap();
        localTreeMap.put("app_key", s.r(paramContext));
        localTreeMap.put("pay_mode", "21");
        localTreeMap.put("platform_id", "2");
        localTreeMap.put("notify_uri", this.b.getStringExtra("notify_uri"));
        localTreeMap.put("product_id", this.b.getStringExtra("product_id"));
        localTreeMap.put("product_name", this.b.getStringExtra("product_name"));
        localTreeMap.put("amount", this.b.getStringExtra("amount"));
        localTreeMap.put("app_uname", this.b.getStringExtra("app_user_name"));
        localTreeMap.put("app_uid", this.b.getStringExtra("app_user_id"));
        localTreeMap.put("app_ext1", this.b.getStringExtra("app_ext_1"));
        localTreeMap.put("app_ext2", this.b.getStringExtra("app_ext_2"));
        localTreeMap.put("user_id", this.b.getStringExtra("qihoo_user_id"));
        localTreeMap.put("sign_type", "md5");
        localTreeMap.put("sign_attr", "1");
        localTreeMap.put("bank_code", "SMS");
        localTreeMap.put("app_order_id", this.b.getStringExtra("app_order_id"));
        localTreeMap.put("access_token", this.b.getStringExtra("access_token"));
        localTreeMap.put("src", s.u(paramContext));
        localTreeMap.put("pay_info1", str1);
        String str2 = b.a(paramContext);
        if (!(TextUtils.isEmpty(str2)))
            localTreeMap.put("quick_info", str2);
        String str3 = b.b(paramContext);
        if (!(TextUtils.isEmpty(str3)))
            localTreeMap.put("risk_control", str3);
        String str4 = s.a(localTreeMap, s.s(paramContext));
        c.a("OACmccSmsPayTask", new Object[] { "https://mgame.360.cn/internal/mobile_pay.json", "?", str4 });
        return localTreeMap;
    }

    protected a b(JSONObject paramJSONObject) {
        if (paramJSONObject != null) {
            int i = paramJSONObject.optInt("error_code", -1);
            String str1 = paramJSONObject.optString("error");
            String str2 = paramJSONObject.optString("order_id");
            String str3 = paramJSONObject.optString("cp_param");
            a locala = new a();
            locala.a(i);
            locala.a(str1);
            locala.b(str2);
            locala.c(str3);
            return locala;
        }
        return null;
    }

    public static class a {
        private int a;
        private String b;
        private String c;
        private String d;

        public boolean a() {
            return ((this.a == 0) && (!(TextUtils.isEmpty(this.c))) && (!(TextUtils.isEmpty(this.d))));
        }

        public void a(int paramInt) {
            this.a = paramInt;
        }

        public String b() {
            return this.b;
        }

        public void a(String paramString) {
            this.b = paramString;
        }

        public String c() {
            return this.c;
        }

        public void b(String paramString) {
            this.c = paramString;
        }

        public String d() {
            return this.d;
        }

        public void c(String paramString) {
            this.d = paramString;
        }
    }
}